package com.chen.service.impl;

import com.chen.dao.InvoiceDao;
import com.chen.model.Invoice;
import com.chen.service.InvoiceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("invoiceService")
public class InvoiceServiceImpl implements InvoiceService {

    @Resource
    private InvoiceDao invoiceDao;

    @Override
    public int addInvoice(Invoice invoice) {
        return invoiceDao.addInvoice(invoice);
    }

    @Override
    public List<Invoice> findAllInvoice() {
        return invoiceDao.findAllInvoice();
    }

    @Override
    public int updateInvoice(Invoice invoice) {
        return invoiceDao.updateInvoice(invoice);
    }

    @Override
    public Invoice findInvoiceById(Integer invoice_id) {
        return invoiceDao.findInvoiceById(invoice_id);
    }

    @Override
    public List<Invoice> findInvoiceByContract(Integer contract_id) {
        return invoiceDao.findInvoiceByContract(contract_id);
    }

    @Override
    public int toSendInvoice(Invoice invoice) {
        return invoiceDao.toSendInvoice(invoice);
    }

    @Override
    public int sendInvoice(Invoice invoice) {
        return invoiceDao.sendInvoice(invoice);


    }
}
